<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/header_cross.inc.asp -->  

<%
	curLotNo = request("lotNo") 
	
	'## ■■ User 정보 가져오기 ■■■■
	userSQL = "SELECT userId, userNm FROM tblUser WHERE delYN='N' AND uLevel<>'05' ORDER BY userNm" 

	Set userRs=Server.CreateObject("ADODB.RecordSet")
	userRs.open userSQL, DbCon, 1
	
	userAll = ""
	If userRs.eof Or userRs.bof Then 
	Else 
		Do Until userRs.eof Or userRs.bof
		
		userAll = userAll & "<option value=""" & userRs("userId") & """>" & userRs("userNm") & "</option>"' & vbcrlf
		userRs.movenext
		Loop 
	End If
	'## ■■ 장비 정보 가져오기 ■■■■
	equipSQL = "SELECT itemNm FROM tblComCode WHERE flag='Y' AND groupCd='0001' ORDER BY itemSeq" 

	Set equipRs=Server.CreateObject("ADODB.RecordSet")
	equipRs.open equipSQL, DbCon, 1
	
	equips = ""
	If equipRs.eof Or equipRs.bof Then 
	Else 
		Do Until equipRs.eof Or equipRs.bof
		
		equips = equips & "<option value=""" & equipRs("itemNm") & """>" & equipRs("itemNm") & "</option>"' & vbcrlf

		equipRs.movenext
		Loop 
	End If
%>

<script language="javascript">    
		 $(document).ready(function() {
			  var clareCalendar = {
			   monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
			   dayNamesMin: ['일','월','화','수','목','금','토'],
			   weekHeader: 'Wk',
			   dateFormat: 'yy-mm-dd',														// 날짜형식(2012-03-03)
			   autoSize: false,																	//자동리사이즈(false 이면 상위 정의에 따름)
			   changeMonth: true,															// true이면 월변경, false이면 월변경못함
			   changeYear: true,																// true이면 년변경, false이면 년변경못함
			   showMonthAfterYear: true,													//년 뒤에 월 표시
			   buttonImageOnly: true,														//이미지표시
			   //buttonText: '달력선택',														//버튼 텍스트 표시
			   //buttonImage: '/calendar.gif',												//이미지주소
			   //showOn: "both",																//엘리먼트와 이미지 동시 사용(both,button)
			   yearRange: 'c-99:c+99',													//1990년부터 2020년까지
			   maxDate: '+2Y',																	// 오늘부터6년후날짜까지만, '+0d' 오늘 이전 날짜만 선택
			   minDate: '-5y'
			  };
			  $("#workDt").datepicker(clareCalendar);
			  $("#startDt").datepicker(clareCalendar);
			  $("#endDt").datepicker(clareCalendar);
			  $("img.ui-datepicker-trigger").attr("style","margin-left:5px; vertical-align:middle; cursor:pointer;"); //이미지버튼 style적용
			  $("#ui-datepicker-div").hide(); //자동으로 생성되는 div객체 숨김  
		});
		
	   $(window).load(function(){
	       grid01List(1);
	    });     
</script>

<BODY topmargin="0" leftmargin="0">

<!-- 검색 영역 시작 -->
<div style="text-align:left;margin-top:10px;">
<table border="0" cellpadding="0" cellspacing="0" width="1000" style="margin-left:5px;">
	<tr height="40">
		<td style="padding: 0px 0 0px 10px;background-image:url(/inc/layout/panel-title-light-bg.gif);font-weight:bold;text-align:left" width="100%" class="lTD_trbl"> &nbsp; 
			LotNO. <input type="text" id="findLotNo" value="<%=curLotNo%>" class="inputBox" style="width:120px;ime-Mode:active"> &nbsp;
			<select id="findProcessCd">
				<option value="001">가공</option>
			</select>
			<input type="button" onClick="grid01List()" value="검 색" class="inputBtn">&nbsp;
			<input type="button" onClick="fnSearchReset()" value="Reset" class="inputBtn">
		</td>
	</tr>
</table>
</div>
<!-- 검색 영역 끝 -->

<br>

<!-- 그리드 시작 -->
<div style="text-align:left">
<table border="0" cellpadding="0" cellspacing="0" width="1000" style="margin-left:5px;text-align:left">
	<tr>
		<td width="100%" class="lTD_trbl" valign="top" style="padding: 5px 5px 5px 5px;">
			<table border="0" cellpadding="0" cellspacing="0" width="670">
				<tr height="24">
					<td style="padding: 0 0 0 0;text-align:left;width:300px"><input type="text" class="subTitle" style="width:80px;height:22px;font-size:10pt" value="가공" ReadOnly>&nbsp;<a href="javascript:grid01List()">[새로고침]</a> &nbsp; </td>
					<td style="padding: 0 20px 0 0;text-align:right;width:370px;"><B>Total :</B> <span id="grid01Cnt" style="font-weight:bold">0</span></td>
				</tr>
			</table>
			<table border="0" cellpadding="0" cellspacing="0" width="670"><tr><td style="background-color:#3366CC;height:2px"></td></tr></table>					
			<div id="grid1">
				<form name="frmGrid01">
				<div id="gridHeader1">
					<div style="width:40px"><p>No.</p></div>
					<div style="width:70px"><p>작업자</p></div>
					<div style="width:90px"><p>작업일</p></div>
					<div style="width:60px"><p>시간</p></div>
					<div style="width:70px"><p>프로그램</p></div>
					<div style="width:60px"><p>장비</p></div>
					<div style="width:60px"><p>양품</p></div>
					<div style="width:60px"><p>불량</p></div>
					<div style="width:60px"><p>총계</p></div>
					<div style="width:71px"><p>비고</p></div>
					<div style="width:18px">&nbsp;</div>
				</div>
				<div id="noResult1">
					<div><p>결과가 없습니다.</p></div>
				</div>
				<div id="gridBody1" style="display:none;">								
				</div>
				<div id="gridTail1" style="">
					<div class="term"></div>
					<div id="pager1"></div>
				</div>
				</form>		
			</div>			
		</td>
		<td valign="top" style="text-align:center; padding-left:5px">					
			<table border="0" cellpadding="0" cellspacing="0" width="310">
				<tr>
				  <td width="100%" class="lTD_trbl" style="padding: 5px 5px 5px 5px; text-align:center">
				  	<input type="text" id="rank" style="display:none">
				  	<input type="text" id="processCd" style="display:none">
					<table border="0" cellpadding="0" cellspacing="0" width="300">
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								LOT &nbsp; NO &nbsp; : &nbsp;<input type="text" id="lotNo" size="15" maxlength="6" class="specialBox" readonly="readonly"> - <input type="text" id="lotSubNo" size="2" maxlength="2" class="specialBox" readonly="readonly">
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								제 &nbsp; 품 &nbsp; 명 &nbsp;: &nbsp;<input type="text" id="prdNm" size="28" class="inputBox" readonly="readonly">
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								작 &nbsp; 업 &nbsp; 자 &nbsp;: &nbsp;										
								<select id="userId"> 
									<option value="">-작업자-</option>
									<%=userAll%>
								</select>&nbsp;					
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								작 업 기 간 &nbsp;: &nbsp;<input type="text" id="startDt" size="11" class="inputBox" onfocus="fnWorkDt('terms')" style="background-color:#f0faff"> - <input type="text" id="endDt" size="11" class="inputBox" style="background-color:#f0faff" onfocus="fnWorkDt('terms')">
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								작 &nbsp; 업 &nbsp; 일 &nbsp;: &nbsp;<input type="text" id="workDt" size="11" class="inputBox" onfocus="fnWorkDt('dt')"> 
								<select id="execTime">
									<option value="">-가공중-</option>
									<option value="[주간]">주간</option>
									<option value="[야간]">야간</option>
								</select>
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								장 &nbsp; &nbsp; &nbsp; &nbsp; 비 &nbsp;: &nbsp;										
								<select id="etc"> 
									<option value="">-장비-</option>
									<%=equips%>
								</select>&nbsp;					
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								프 로 그 램 &nbsp;: &nbsp;<input type="text" id="working" size="15" class="inputBox"> 
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								양품/불량 &nbsp; : &nbsp;	<input type="text" id="goodQty" size="4" class="inputBox" onBlur="fnAutoCount()" style="text-align:right;padding-right:3px"> / <input type="text" id="badQty" size="4" class="inputBox" onBlur="fnAutoCount()" style="text-align:right;padding-right:3px">  
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								총 &nbsp; &nbsp; &nbsp; &nbsp; 계 &nbsp;: &nbsp;	<input type="text" id="totalQty" size="5" class="inputBox" onFocus="fnAutoCount()" style="text-align:right;padding-right:3px">  
							</td>
						</tr>
						<tr>
							<td height="30" width="300" class="lTD_00b0" style="padding: 5px; text-align:center; font-weight:bold">
								<textarea id="orderMemo" style="width:280px;height:50px"></textarea> 
							</td>
						</tr>
						<tr style="display:<%=isPerm%>">
							<td height="30" width="300" class="lTD_00b0" style="padding: 0 0 0 20px; text-align:left; font-weight:bold">
								<select name="flag" id="flag">
									<option value="Y">유효</option>
									<option value="N">무효</option>
								</select> &nbsp; &nbsp;<input type="text" id="accessInfo" style="font-weight:normal;width:100px; border:0px">
								<span>
								<input type="button" value="저장" class="inputBtn" onClick="fnSave()"> 
								<input type="button" value="신규" class="inputBtn" onClick="fnReset()">
								</span>
							</td>
						</tr>
					</table>
				  </td>
				</tr>
			</table>
		</td>		
		<td width="185">
			<table border="0" cellpadding="0" cellspacing="0" width="147">
				<tr>
					<td>&nbsp;</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</div>
<!-- 그리그 끝 -->

<script language="javascript">
	setMainMenu();
//$("#findLotNo").val('<%=curLotNo%>');
//	//## 테스트를 위한 기본 값세팅	
//	$("#prdNm").val("연습00");
//	$("#etcPrdCd").val("TEST01-00");
//	$("#remarks").val("연습중\r\nThis is testing....");
</script>
</BODY>
</HTML>